package com.shujia.tf

import com.shujia.bean.CarWide
import org.apache.flink.api.common.functions.{RichFilterFunction, RichMapFunction}
import org.apache.flink.configuration.Configuration
import redis.clients.jedis.Jedis

class CarBkJoinRedisFilter extends RichFilterFunction[CarWide] {


  var jedis: Jedis = _

  override def open(parameters: Configuration): Unit = {
    jedis = new Jedis("node1", 6379)

  }

  override def filter(value: CarWide): Boolean = {
    val key = "bk_list"
    //判断是否存在
    jedis.sismember(key, value.getCarId)
  }
}
